﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace XNAGame_Lab1
{
    public class Map : VisibleGame
    {
        float _Scale = 1.0f;
        private Vector2 unknowVar;

        public Vector2 UnknowVar
        {
            get { return unknowVar; }
            set { unknowVar = value; }
        }
        public  Map(ContentManager content, string strTexture,  Vector2 topleft,  Vector2 size)
        {
            TopLeft = topleft;
            Size = size;
           
            Sprites = new List<MySprites2D>();
            Texture2D[] texture = new Texture2D[1];
            //for (int i = 0; i < nSprites; i++)
                texture[0] = content.Load<Texture2D>(strTexture);

                MySprites2D mySprite = new MySprites2D(texture, topleft) { Size = size };
            Sprites.Add(mySprite);
            this.nSprites = Sprites.Count; 

        }
        public override void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            if (Size.X != 0)
            {
                Sprites[0].Position = TopLeft * _Scale;
                Vector2 temp = Sprites[0].Size;
                temp.X = temp.X * _Scale;
                temp.Y = temp.Y * _Scale;
                Sprites[0].Size = temp;
            }
            //duoi day la di chuyen man hinh map
            //Sprites[0].Position = -unknowVar;
            base.Draw(gameTime, spriteBatch);
        }
     
    }
}
